<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('帮助与反馈列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>手机号：</label>
                            <input type="text" name="phoneNum"/>
                        </li>
                        <li>
                            <lable>用户类型:</lable>
                            <select name="questionType" >
                                <option value="">请选择</option>
                                <option value="1">用户提问</option>
                                <option value="2">商家提问</option>
                            </select>
                        </li>
                        <li>
                            <lable>问题类型:</lable>
                            <select name="handleType"th:with="type=${@dict.selectHandleTypeList()}" >
                                <option value="">请选择</option>
                                <option th:each="dict : ${type}" th:text="${dict.typeName}" th:value="${dict.id}"></option>
                            </select>
                        </li>
                        <li class="select-time">
                            <label>提问时间： </label>
                            <input type="text" class="time-input"  placeholder="开始时间"
                                   name="params[beginTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input"  placeholder="结束时间"
                                   name="params[endTime]"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <!--  <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="wxHelp:wxHelp:add">
                  <i class="fa fa-plus"></i> 添加
              </a>
              <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="wxHelp:wxHelp:edit">
                  <i class="fa fa-edit"></i> 修改
              </a>-->
              <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="wxHelp:wxHelp:remove">
                  <i class="fa fa-remove"></i> 删除
              </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('wxHelp:wxHelp:edit')}]];
    var removeFlag = [[${@permission.hasPermi('wxHelp:wxHelp:remove')}]];
    var prefix = ctx + "wxHelp/wxHelp";

    $(function () {
        var options = {
            url: prefix + "/doneHelpList",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            detailUrl: prefix + "/detail/{id}",
            showSearch: false,
            showRefresh: false,
            showColumns: false,
            showToggle: false,
            modalName: "帮助与反馈",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: 'null',
                    visible: false
                },
                {
                    field: 'toQuestion',
                    title: '问题'
                },
                {
                    field: 'questionType',
                    title: '问题类型',
                    formatter: function (value, row, index) {
                        if (value == 1) {
                            return "<span class='badge badge-primary'>用户提问</span>";
                        }
                        return "<span class='badge badge-danger'>商铺提问</span>";
                    }
                },
                {
                    field: 'showName',
                    title: '来源名称/单位'
                },
                {
                    field: 'phoneNum',
                    title: '联系方式'
                },
                {
                    field: 'createTime',
                    title: '提问时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-search"></i>查看详情</a> ');
                       actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>